/*
 * ******************************************************************************
 * sdrtrunk
 * Copyright (C) 2014-2018 Dennis Sheirer
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 * *****************************************************************************
 */

package io.github.dsheirer.module.decode.p25.reference;

public enum MaximumTransmitUnit
{
    RESERVED(0),
    BYTES_296(296),
    BYTES_510(510),
    BYTES_1020(1020),
    BYTES_1500(1500);

    private int mByteCount;

    MaximumTransmitUnit(int byteCount)
    {
        mByteCount = byteCount;
    }

    public int getByteCount()
    {
        return mByteCount;
    }

    public static MaximumTransmitUnit fromValue(int value)
    {
        switch(value)
        {
            case 1:
                return BYTES_296;
            case 2:
                return BYTES_510;
            case 3:
                return BYTES_1020;
            case 4:
                return BYTES_1500;
            default:
                return RESERVED;
        }
    }
}